<?php 

Class msgModel extends AppModel
{
	
     public function insert_msg($info)
	{
		$field='';
		$value='';
		
		foreach($info as $k=>$v)
		{
			if($v!='')
			{
				$field.="$k,";
	
	
				$value.="'$v',";
					
			}
		}
			
			
		$field.="created,ip";
		$value.="'".$_SERVER['REQUEST_TIME']."','".hy_getIP()."'";
			
		$sql="INSERT INTO ".$this->table('feed')." (".$field.") VALUES(".$value.")";
	
	
		return $res=$this->query($sql);
	}
	
}